package com.woniuxy.woniuticket.resultcommon;
/*
* 该类是返回前端页面的数据绑定类
* */

public class JsonResult {

    private String msg;      //提示信息
    private Integer code;    //状态码
    private Object result;   //绑订数据

    public JsonResult() { }

    public JsonResult(String msg, Integer code, Object result) {
        this.msg = msg;
        this.code = code;
        this.result = result;
    }

    public JsonResult(String msg, Integer code) {
        this.msg = msg;
        this.code = code;
    }

    public JsonResult(String msg) {
        this.msg = msg;
    }

    public JsonResult(Integer code) {
        this.code = code;
    }

    public static JsonResult ok(String msg,Object object){
        return new JsonResult(msg,200,object);
    }

    public static JsonResult ok(String msg){
        return new JsonResult(msg,200);
    }

    public static JsonResult ok(){
        return new JsonResult(200);
    }

    public static JsonResult error(){
        return new JsonResult(500);
    }

    public static JsonResult error(String msg){
        return new JsonResult(msg,500);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
